﻿/*****************************************************************************  

 Version: 0.1
 Website: http://www.visuagile.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace VisualAgile.Model
{
    public partial class Role
    {
        public override string ToString()
        {
            return Name;
        }

        public const int AdministratorId = 1;
        public const int LeadDeveloperId = 2;
        public const int DeveloperId = 3;
        public const int GuestId = 4;

        // allowed roles. These must match the data in table Role
        public static Role Administrator { get { return new Role() { RoleID = AdministratorId, Name = "Manager" }; } }
        public static Role LeadDeveloper { get { return new Role() { RoleID = LeadDeveloperId, Name = "Lead Developer" }; } }
        public static Role Developer { get { return new Role() { RoleID = DeveloperId, Name = "Developer" }; } }
        public static Role Guest { get { return new Role() { RoleID = GuestId, Name = "Guest" }; } }

        public virtual bool IsAdministrator { get { return Name == Administrator.Name; } }
        public virtual bool IsLeadDeveloper { get { return Name == LeadDeveloper.Name; } }
        public virtual bool IsDeveloper { get { return Name == Developer.Name; } }
        public virtual bool IsGuest { get { return Name == Guest.Name; } }

        /// <summary>
        /// Created Date
        /// </summary>
        public virtual DateTime CreateTime
        {
            get;
            set;
        }

        /// <summary>
        /// Created by
        /// </summary>
        public virtual System.String Creator
        {
            get;
            set;
        }


        /// <summary>
        /// Role GUID
        /// </summary>
        public virtual Guid RoleGUID
        {
            get;
            set;
        }

        /// <summary>
        /// Role id
        /// </summary>
        public virtual int RoleID
        {
            get;
            set;
        }


        /// <summary>
        /// Project name
        /// </summary>
        public virtual System.String Name
        {
            get;
            set;
        }        
    }   
}
